{% if form.errors %}
    <div class="form-errors">
        {% for field in form %}
            {% for error in field.errors %}
                <p class="form-error red-color"><strong>*{{field.label}}: {{ error|escape }}</strong></p>
            {% endfor %}
        {% endfor %}
        {% for error in form.non_field_errors %}
            <p class="form-error red-color"><strong>*{{ error|escape }}</strong></p>
        {% endfor %}
    </div>
{% endif %}
{# Form design is borrowed from "http://www.sanwebe.com/2014/08/css-html-forms-designs" #}
{% if form.instance %}
<form class="djacket-form" action="/{{repo_owner}}/{{repo.name}}.git/settings" role="form" method="POST">
{% else %}
<form class="djacket-form" action="{% url 'new_repository' %}" role="form" method="POST">
{% endif %}
    {% csrf_token %}
    <ul>
        <li>
            <label for="id_name">Name*</label>
            <input id="id_name" name="name" type="text" value="{{ form.instance.name }}">
            <span>Enter a name for repository.</span>
        </li>
        <li>
            <label for="id_description">Description</label>
            <input id="id_description" name="description" type="text" value="{{ form.instance.description }}">
            <span>Enter a description for repository.</span>
        </li>
        <li>
            <label for="id_private">Private</label>
            {% if form.instance %}
                {% if form.instance.private %}
                    <input id="id_private" name="private" type="radio" value="true" checked>Yes</input>
                    <input id="id_private" name="private" type="radio" value="false">No</input>
                {% else %}
                    <input id="id_private" name="private" type="radio" value="true">Yes</input>
                    <input id="id_private" name="private" type="radio" value="false" checked>No</input>
                {% endif %}
            {% else %}
                <input id="id_private" name="private" type="radio" value="true">Yes</input>
                <input id="id_private" name="private" type="radio" value="false" checked>No</input>
            {% endif %}
            <span class="last-span">Specify if repository should be private.</span>
        </li>
        <li>
            <input class="success" type="submit" value="Save Changes">
        </li>
    </ul>
</form>
{# Form design is borrowed from "http://www.sanwebe.com/2014/08/css-html-forms-designs" #}
